import { Channel } from '@/types/data'

// 封装一些频道的本地操作
const CHANNELS_KEY = 'geek-channels-99'

// 设置到本地
export function setChannels(channels: Channel[]) {
  localStorage.setItem(CHANNELS_KEY, JSON.stringify(channels))
}

// 获取
export function getChannels(): Channel[] {
  return JSON.parse(localStorage.getItem(CHANNELS_KEY) || '[]')
}
